Field of the Invention
The present invention relates to a communicating apparatus for performing wireless communication via a wireless channel, a communication method, and a storage medium storing a program.
Description of the Related Art
In a wireless communication system, in addition to a method (for example, an infrastructure mode) of establishing a wireless connection with a partner apparatus via an access point, there is known a peer-to-peer (P2P) wireless connection method in which a self apparatus or a partner apparatus serves as an access point, thereby directly, establishing a wireless connection with the partner apparatus without intervention of a third apparatus.
There is known, for example, Wi-Fi Direct® as a standard for implementing such P2P wireless connection method. A Wi-Fi Direct compatible apparatus can serve as an access point (group owner), thereby allowing direct wireless connection with a partner apparatus. At this time, whether the partner apparatus or the self apparatus serves as an access point is decided according to a sequence called Group Owner Negotiation (Japanese Patent Laid-Open No. 2011-249960).
It is possible to simultaneously execute the above-described two different wireless connection methods in one apparatus. This is a case in which a self apparatus serves as a client to establish a wireless connection with an access point while serving as a group owner to establish a P2P wireless connection with another apparatus serving as a client. In this case, two channels are required as wireless interfaces. However, assigning a plurality of channels to one wireless IC chip makes an arrangement very complicated. When simultaneously executing the two wireless connection methods, therefore, it is desirable to use a common channel in the methods.
In general, if the self apparatus serves as a client, an access point has a leading role in deciding a channel to be used. Alternatively, if the self apparatus serves as a group owner, a channel to be used is decided by comparing client channel information obtained by Group Owner Negotiation with its usable channels.
Assume that the above self apparatus, access point, and client are wirelessly connected by a common channel. In this case, if the self apparatus and the access point are disconnected, the self apparatus has no right to decide a channel, and may not be able to perform reconnection with a channel before disconnection.